home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Eagles Nest BBS 7
/
Eagles_Nest_Mac_Collection_Disc_7.TOAST
/
Needs [K]
/
DW550cPS#2
/
Install 2.image
/
Server Support
/
hpdw550c.ps
< prev
next >
Wrap
Text File
|
1993-06-22
|
6KB
|
207 lines
%
% This file defines the PostScript ProcSet resource /HPDW550C which currently contains the
% routine InstallDWRender and the definition of the transfer function procedure.
%
/HPDW550C <<
%
% Routine: InstallDWRender
%
% Input: ProcessColorModel
% This is the device color model that CPSI is currently
% instantiated with.
%
% MediaType This is the type of paper chosen in by the user from the
% print menu. Possible types are:
%
% plainpaper (default)
% hpspecialpaper
% hpglossypaper
% transparency
%
% Output: None Upon return from the routine the appropriate color rendering
% dictionary, halftone and transfer functions will have been
% loaded, depending upon the media type and color model. Some of the
% media types and color models will probably use the same dictionaries,
% halftones, etc. This will be determined as we go along by the
% quality of the output.
%
% Description: This routine uses the color model and media type strings to obtain
% a procedure that will load the appropriate graphics parameters.
% It does this by using the media type string (it is on top of the
% stack when this routine is entered) as a key into a dictionary who's
% keys are all the possible media types, and the dictionary values are
% another dictionary. There is a dictionary for each media type and
% each of those dictionaries have 3 keys, which are the color model
% types. The color model string is then used to index into the dictionary
% and return a procedure, which is then executed. The procedure contains
% code to load the appropriate graphics parameters.
%
% History: 12/01/93 KM Created.
%
/InstallDWRender
{
% on stack -- colormodel, media type (media type on top)
% IF (the media type and colormodel on the stack are different than the
% currentmedia and currentcolormodel keys) THEN
% load in new graphics parameters
% ELSE
% leave the graphics parameters as is
%
dup
null ne
{ dup }
{ pop (plainpaper) dup } % remove bad media type, replace with plainpaper
ifelse
HPMediaDict /currentmedia get
ne % compare currentmedia and new media
2 index
HPMediaDict /currentcolormodel get
ne % compare currentcolormodel and new colormodel
or % if either are different then load new graphics parameters
{
% update the current values
HPMediaDict /currentmedia 2 index put
HPMediaDict /currentcolormodel 3 index put
% load the new graphics parameter values
HPMediaDict exch get % get the paper type dictionary
exch get % get the colormodel
exec % execute the procedure
}
{
pop pop % remove media and colormodel from stack
}
ifelse
} % end InstallDWRender
% Define transfer function routine in the ProcSet so it will be a resource too
%
% Routine: DefaultTransfer
%
% Input: color value The interpreter passes the transfer function a color
% value and it's job is to possibly alter the value to
% compensate for non-linear differences between the color
% as specified vs how the device can produce it. Refer
% to the "Red Book" for more info.
%
% Output: adjusted color A value from 0 to 1, may be the same as the input value.
%
% Description: Currently, this routine is doing nothing. Eventually it
% should do gamma correction.
%
% History: 12/01/92 KM Created. Didn't do anything originally.
% 01/11/93 KM Changed to use a look up table to determine the new value.
% The table in the first release came from a book, this will
% be changed soon to a gamma correction measured from our
% output.
% 02/18/93 KM Changed to use a table tuned from scanning some sample
% output from printer, now dividing by 255 as samples range
% from 0 to 255.
% 04/15/93 KM Changed to use a different array for color and black.
% 05/19/93 KM Not using a table anymore to find adjusted value, let PS
% interpreter do the math (using base to the exponent power).
% Also added different transfer functions for special paper and
% different colormodels.
/DefaultTransfer
{
{
0.4 exp
}
{
0.4 exp
}
{
0.4 exp
}
{
0.7 exp
}
setcolortransfer
} % end DefaultTransfer
%
% Routine: GrayTransfer
%
% Description:
% Grayscale value needs to be something different than CMYK.
%
/GrayTransfer
{
{
0.6 exp
}
settransfer
} % end SpecialGrayTransfer
%
% Routine: SpecialGrayTransfer
%
% Description:
% HP Special paper requires a different transfer function than
% plain paper. This one is for DeviceGray
%
/SpecialGrayTransfer
{
{
0.275 exp
}
settransfer
} % end SpecialGrayTransfer
%
% Routine: SpecialTransfer
%
% Description:
% HP Special paper requires a different transfer function than
% plain paper. This one is for DeviceCMY and DeviceCMYK
%
/SpecialTransfer
{
{
0.275 exp
}
{
0.275 exp
}
{
0.275 exp
}
{
0.275 exp
}
setcolortransfer
} % end SpecialTransfer
%
% Routine: EmptyGrayTransfer
%
% Description:
% This sets the transfer function to be empty (i.e., don't muck
% with the values).
%
/EmptyGrayTransfer
{
{} settransfer
} % end EmptyGrayTransfer
%
% Routine: EmptyTransfer
%
% Description:
% This sets the transfer function to be empty (i.e., don't muck
% with the values). Used for DeviceCMY and DeviceCMYK
%
/EmptyTransfer
{
{} {} {} {} setcolortransfer
} % end EmptyTransfer
>> /ProcSet defineresource